package com.bootdo.check.controller;

import java.util.*;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.bootdo.common.utils.PageUtils;
import com.bootdo.common.utils.Query;
import com.bootdo.check.domain.CheckDO;
import com.bootdo.check.service.CheckService;

@Controller
@RequestMapping("/check/check")
public class CheckController {

	@Autowired
	private CheckService checkService;
	
	@GetMapping()
	@RequiresPermissions("check:check:check")
	String Stock(){
	    return "check/check/check";
	}

	@ResponseBody
	@GetMapping("/list")
	@RequiresPermissions("check:check:check")
	public PageUtils list(@RequestParam Map<String, Object> params){
		//查询列表数据
        Query query = new Query(params);
		List<CheckDO> checkList = checkService.list(query);
		int total = checkService.count(query);
		PageUtils pageUtils = new PageUtils(checkList, total);
		return pageUtils;
	}

}
